import request from '../util/request'
export function getSwiperList (type) {
  return request({
    url: '/api/front/index/banner',
    method: 'get',
    params: { type }
  })
}
export function getActivityList (status, page) {
  return request({
    url: '/api/front/activity',
    method: 'get',
    params: { status, size: 5, page }
  })
}
export function getActivityDetail ({ id }) {
  return request({
    url: `/api/front/activity/${id}`,
    method: 'get'
  })
}
export function signUpActivity (id) {
  return request({
    url: '/api/front/activity/apply',
    method: 'post',
    data: { id }
  })
}
export function getDesignerList (page, rate, form, style) {
  return request({
    url: '/api/front/designer',
    method: 'get',
    params: { page, rate, form, style }
  })
}
export function getDesignerDetail (id) {
  return request({
    url: `/api/front/designer/${id}`,
    method: 'get'
  })
};
export function getDesignerCaseDetail (id) {
  return request({
    url: `/api/front/designer/case/${id}`,
    method: 'get'
  })
}
export function appointmentDesigner ({ designerId, phone, name, captcha, message }) {
  return request({
    url: '/api/front/user/appointment',
    method: 'post',
    data: { designer_id: designerId, phone, name, captcha, message }
  })
}
export function getBrandList (page) {
  return request({
    url: '/api/front/brand',
    method: 'get',
    params: { page }
  })
}
export function getBrandItemDetail (id) {
  return request({
    url: `/api/front/brand/${id}`,
    method: 'get'
  })
}
// 设计师入住
export function designerJoin ({ phone, name, captcha, companyName }) {
  return request({
    url: '/api/front/designer/apply',
    method: 'post',
    data: { phone, name, captcha, company_name: companyName }
  })
}
export function getCouponList () {
  return request({
    url: '/api/front/user/coupon',
    method: 'get'
  })
}
// 领取优惠券
export function getCouponByShare ({ id, designerId }) {
  return request({
    url: '/api/front/user/coupon',
    method: 'post',
    data: { id, designer_id: designerId }
  })
};
